﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.AspNet.Identity.EntityFramework;

namespace SDCloudSolution.SDCloud.Entities.Identity
{
    /// <summary>
    /// Represents a user external logins information.
    /// </summary>
    [Table("user_logins")]
    public class ApplicationUserLoginEntity : IdentityUserLogin<int>
    {
        /// <summary>
        /// The external authorization provider name.
        /// </summary>
        [Column("AccountProviderType")]
        public override string LoginProvider { get; set; }

        /// <summary>
        /// The account identifier from external authorization provider.
        /// </summary>
        [Column("AccountIdentifier")]
        public override string ProviderKey { get; set; }

        /// <summary>
        /// Date when this external account was used for authorization.
        /// </summary>
        [Column("LastActiveDateUtc")]
        public DateTime LastActiveDateUtc { get; set; }

        /// <summary>
        /// Indicates that this external account can be used for authorize in our system.
        /// </summary>
        [Column("IsActive")]
        public bool IsActive { get; set; }
    }
}
